package com.tegtech.starter.redisson;

import java.util.concurrent.TimeUnit;

import org.redisson.api.RLock;

/**
 * 分布式锁api
 * @Author Jun
 * @date 2019年12月25日 下午7:05:48
 */
public interface DistributedLocker {

	RLock lock(String lockKey);

    RLock lock(String lockKey, int timeout);

    RLock lock(String lockKey, TimeUnit unit, int timeout);

    RLock fairLock(String lockKey);

    boolean tryLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);

}
